﻿@model S4Store.Models.AfterSaleReport.AfterSaleReportServiceAdvisorModel
@{
    ViewBag.Title = "CarBrandDecoratingSaleKPI";
    Layout = null;
    var config = Model.StandardConfigs.FirstOrDefault();
}
<div style="height: 100%; overflow: auto">
    @Html.Action("ReportBar", "Common", Model.BarModel)
    @if (Model.SADayDatas == null || Model.MonthTargets == null || Model.MonthTargets.FirstOrDefault() == null || config == null)
    {
        <text>查询不到该月数据</text>
        return;
    }
    <div style="position: relative; width: 100%">
        <div class="pagetitle">
            @(Model.MonthTargets.FirstOrDefault().Employee.Name)
            服务顾问过程管理数据
        </div>
        <div style=" width:90%; margin:0 auto;">
        <table class="reporttable" style="border-collapse: collapse; width:100%">
            <thead>
                <tr>
                    <th class="tb_header_lightbluebg">
                        <div>
                            售 后 前 台 接 待 姓 名
                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            接 待 前 台 职 业 资 质
                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            上月末分管客户总数
                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            本月 A 卡转 C 卡客户数
                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            分管保有客户总数
                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            本月新增六个月未回厂数

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            本月新增四个月未回厂数

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            本月招徕回厂目标数

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            本月目标预约入厂台次

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            目标入厂台次

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            客户满意度考核目标

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            累计完成入厂台次

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            成功实施电话招徕客户数

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            电话成功预约回厂数

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            累计实现预约回厂数

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            准时交车客户数

                        </div>
                    </th>
                    <th class="tb_header_lightbluebg">
                        <div>
                            满意度回访平均得分

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            招徕实施率

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            招  徕   实   施   完   成   差  异

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            预约成功率

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            失约率

                        </div>
                    </th>
                    <th class="tb_header_bluebg">
                        <div>
                            准时交车率

                        </div>
                    </th>
                </tr>
            </thead>


                            
                <tr>
                    <td> @(Model.MonthTargets.FirstOrDefault().Employee.Name)
                    </td>

                    <td> @(Model.MonthTargets.FirstOrDefault().Employee.WorkYear)年
                    </td>

                    <td>@(Model.MonthTargets.FirstOrDefault().SYMFGKHZS_LastMonthManageCustomerNum)
                    </td>

                    <td> @(Model.SADayDatas.Sum(o=>o.BYAKZCKKHS_ACard2CCard))
                    </td>

                    <td> @(Model.GetFGBYKHZS(Model.MonthTargets.FirstOrDefault().EmployeeId, Model.BarModel.Month.Year, Model.BarModel.Month.Month))
                    </td>

                    <td>@(Model.SADayDatas.Sum(o=>o.XZLGYWHCS))
                    </td>
                    <td>@(Model.SADayDatas.Sum(o=>o.XZSGYWHCS))
                    </td>

                    <td>@(Model.MonthTargets.FirstOrDefault().BYYZHCMBS_ReturnFactoryTarget)
                    </td>


                    <td>@(Model.GetBYMBRCTC(Model.MonthTargets.FirstOrDefault().EmployeeId,Model.BarModel.Month.Year,Model.BarModel.Month.Month))
                    </td>

                    <td>@(Model.MonthTargets.Sum(o => o.BYSGCRCTCMB_AccidentCarToFactoryTarget + o.BYWXRCTCMB_MaintenceCarToFactoryTarget + o.BYYSSWKBYS_5KMaintenceTarget + o.BYYSSSQBYS_10KMaintenceTarget))
                    </td>

                    <td>@(Model.MonthTargets.FirstOrDefault().KHMYDKHMB_CustomerSatisfactionTarget)
                    </td>


                    <td>@(Model.SADayDatas.Sum(o=>o.WXRCTC_MaintentceToFactory+o.SGRCTC_AccidentToFactory))
                    </td>

                    <td>@(Model.SADayDatas.Sum(o=>o.DHZLKHS_InviteByTelNum))
                    </td>

                    <td>@(Model.SADayDatas.Sum(o=>o.DHCGYYHCS))
                    </td>

                    <td>@(Model.SADayDatas.Sum(o=>o.SXYYHCS))
                    </td>

                    <td>@(Model.SADayDatas.Sum(o=>o.ZSJCKHS))
                    </td>

                    <td>@(Model.SADayDatas.Sum(o=>o.MYDHFPJDF))
                    </td>


                    <td @if (config.招徕实施率目标 > Model.GetZLSSL(Model.MonthTargets.FirstOrDefault().EmployeeId, Model.BarModel.Month.Year, Model.BarModel.Month.Month))
                    {
                            <text>style="background:#ff1100"</text>
                    }
                >@(Model.GetZLSSL(Model.MonthTargets.FirstOrDefault().EmployeeId,Model.BarModel.Month.Year,Model.BarModel.Month.Month))%
                    </td>


                    <td @if (Model.GetZLSSLCY(Model.MonthTargets.FirstOrDefault().EmployeeId, Model.BarModel.Month.Year, Model.BarModel.Month.Month)<0)
                    {
                            <text>style="background:#ff1100"</text>
                    }
                >@(Model.GetZLSSLCY(Model.MonthTargets.FirstOrDefault().EmployeeId,Model.BarModel.Month.Year,Model.BarModel.Month.Month))%
                    </td>

                    <td @if (config.预约成功率目标 > Model.GetYYCGL(Model.MonthTargets.FirstOrDefault().EmployeeId, Model.BarModel.Month.Year, Model.BarModel.Month.Month))
                    {
                            <text>style="background:#ff1100"</text>
                    }
                >@(Model.GetYYCGL(Model.MonthTargets.FirstOrDefault().EmployeeId,Model.BarModel.Month.Year,Model.BarModel.Month.Month))%
                    </td>

                    <td>@(Model.GetSYL(Model.MonthTargets.FirstOrDefault().EmployeeId,Model.BarModel.Month.Year,Model.BarModel.Month.Month))%
                    </td>

                    <td @if (config.准时交车率目标 > Model.GetSAZSJCL(Model.MonthTargets.FirstOrDefault().EmployeeId, Model.BarModel.Month.Year, Model.BarModel.Month.Month))
                    {
                            <text>style="background:#ff1100"</text>
                    }
                >@(Model.GetSAZSJCL(Model.MonthTargets.FirstOrDefault().EmployeeId, Model.BarModel.Month.Year, Model.BarModel.Month.Month))%
                    </td>
                </tr>
        </table>
        </div>
    </div>
</div>
